package com.itheima.thread05;

import com.itheima.thread04.Desk;

import java.util.concurrent.ArrayBlockingQueue;

//生产者
public class Cooker implements Runnable {
    private ArrayBlockingQueue<String> list;
    public Cooker(ArrayBlockingQueue<String> list) {
        this.list = list;
    }

    @Override
    public void run() {
        try {
            list.put("汉堡");
            System.out.println("厨师放入了一个汉堡");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
